import http from '../../utils/request/request'


//分页查询检测记录
export function getProduct(current = 1, size = 5) {
    return http({
        url: `/breed/product/${current}/${size}`,
        method: 'get'
    })
}
//分页根据条件查询检测记录
export function getInspectionByCondition(current = 1, size = 5, data) {
    return http({
        url: `/breed/inspection/condition/${current}/${size}?startTime=${data.startTime}&overTime=${data.overTime}&type=${data.type}`,
        method: 'get',
        data
    })
}
//分页根据搜索词查询检测记录
export function getProductByKeyword(current = 1, size = 5, keyword) {
    return http({
        url: `/breed/product/keyword/${current}/${size}/${keyword}`,
        method: 'get'
    })
}
//添加产品
export function newProduct(data){
    return http({
        url: `/breed/product`,
        method: 'post',
        data
    })
}
// 根据id删除检测报告
export function removeProduct(id) {
    return http({
        url: `/breed/product/${id}`,
        method: 'delete'
    })
}
export function removeProducts(data) {
    return http({
        url: `/breed/product/batch`,
        method: 'delete',
        data
    })
}
export function editProduct(data) {
    return http({
        url: `/breed/product`,
        method: 'put',
        data
    })
}
// 
export function getBase() {
    return http({
        url: `/breed/base/baseMap`,
        method: 'get'
    })
}
// 养殖作业、档案页面用到， 获取sku
export function getSKU() {
    return http({
        url: `/breed/product/sku`,
        method: 'get'
    })
}